HatchShape AddHatchPattern

Adds a Hatching pattern to the Hatch Shape. Define the pattern settings using the hatch pattern object.

 

public void AddHatchPattern(HatchPattern hatchPattern)

 

Return value

void  

 

Parameters

HatchPattern hatchPattern Hatching pattern settings

 

Example

Copy
scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);

if (scanDocument != null)
{
    VectorImage vectorImage = scanDocument.CreateVectorImage("image1", DistanceUnit.Millimeters);

    vectorImage.SetMarkSpeed(1000);
    vectorImage.SetJumpSpeed(2000);
    vectorImage.SetJumpDelay(100);
    vectorImage.SetMarkDelay(100);

    //Set Laser Delays
    vectorImage.SetLaserOnDelay(10);
    vectorImage.SetLaserOffDelay(10);

    vectorImage.AddEllipticalArc(0, 0, 0, 10, 0, 3, 0, 120 * (float)(Math.PI / 180));

    HatchShape hatchShape = new HatchShape();

    HatchPatternLine lineHatch = new HatchPatternLine();
    lineHatch.Spacing = 0.05f;
    lineHatch.BorderGap = 0.5f;
    lineHatch.BorderGapDirection = HatchLineBorderGapDirection.Inward;
    lineHatch.LineStyle = HatchLineStyle.Serpentine;
    lineHatch.OffsetAlgorithm = HatchOffsetAlgorithm.DirectOffset;
    lineHatch.WithOffset = true;
    lineHatch.CornerStyle = HatchCornerStyle.Sharp;

    hatchShape.AddHatchPattern(lineHatch);

    hatchShape.AddEllipticalArc2D(0, 0, 10, 0, 3, 0, 120 * (float)(Math.PI / 180));

    vectorImage.AddHatch(hatchShape, 0);

    scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()"));

    try
    {
        scanDocument.StartScanning();
    }
    catch (Exception exp)
    {
        MessageBox.Show(exp.Message);
    }
}